package com.lc202309;

/**
 * Description:
 *
 * @Create 2023/9/13 22:38
 * @Version 1.0
 */
public class Solution88 {
    public void merge(int[] nums1, int m, int[] nums2, int n) {
        int length = nums1.length;
        for (int i = 0; i < length; i++) {
            if (n == 0) {
                return;
            }
            if (m == 0) {
                nums1[length - 1 - i] = nums2[n - 1];
                n--;
                continue;
            }
            if (nums1[m - 1] > nums2[n - 1]) {
                nums1[length - i - 1] = nums1[m - 1];
                m--;
                continue;
            }
            nums1[length - i - 1] = nums2[n - 1];
            n--;
        }
    }
}
